package a66weding.com.jiehuntong.http;

import a66weding.com.jiehuntong.application.DataWareHourse;
import a66weding.com.jiehuntong.common.api.Url;

/**
 * @version :
 * @creator : AxDu
 * @create-time : 2016/5/24
 * @description :处理Url的拼接等操作的工具类
 */
public class UrlDealUtil {
    private static String id = "";
    public static String getRealUrl(String webInterface) {
        String newUrl = Url.BASE + webInterface + "?Token=" + Url.TOKEN + "&i_Id=" + getId();
        return newUrl;
    }

    // 添加一个没有加ID的url
    public static String getRealUrlNoId(String webInterface) {
        String newUrl = Url.BASE + webInterface + "?Token=" + Url.TOKEN;
        return newUrl;
    }

    // 添加一个添加新的ID字段的含有API的
    public static String getRealUrlNewIdApi(String webInterface) {
        String newUrl = Url.BASE_API + webInterface + "?Token=" + Url.TOKEN + "&memberID=" + getId();
        return newUrl;
    }

    // 添加一个没有ID字段的含有API的
    public static String getRealUrlNoIdApi(String webInterface) {
        String newUrl = Url.BASE_API + webInterface + "?Token=" + Url.TOKEN;
        return newUrl;
    }

    // 添加一个添加新的ID字段的url
    public static String getRealUrlNewId(String webInterface) {
        String newUrl = Url.BASE + webInterface + "?Token=" + Url.TOKEN + "&memberID=" + getId();
        return newUrl;
    }
    // 添加一个含有ApiSd的字段url 注意这里是用用户的手机号
    public static String getRealUrlNoIdApiSd(String webInterface) {
        String newUrl = Url.BASE2 + webInterface + "?Token=" + Url.TOKEN + "&mobileStr=";
        return newUrl;
    }
    public static String getId() {
        id = DataWareHourse.getInstance().getmUser().getData().get(0).getI_Id() + "";
        return id;
    }

    public static void setId(String id) {
        UrlDealUtil.id = id;
    }

 /*   public static void setMemberID(String memberID) {
        UrlDealUtil.memberID = memberID;
    }*/

    public static String getMemberID() {
        id = DataWareHourse.getInstance().getmUser().getData().get(0).getI_Id() + "";
        return id;
    }
}
